import styles from './index.module.scss';
import { useState } from 'react';

import Left from './left';
import Right from './right';
import { Post } from '../../types';

function PageWorkspace() {
  const [post, setPost] = useState<Post | undefined>(undefined);

  console.log(post);

  return (
    <div className={styles['page']}>
      <div className={styles['left']}>
        <Left onPostClick={(post) => setPost(post)} />
      </div>
      <div className={styles['right']}>{post && <Right post={post} />}</div>
    </div>
  );
}

export default PageWorkspace;
